package regexppractice;

/**
 * @description:
 * @author: jhy
 * @time: 2021/6/1 21:40
 */

//验证一个字符串是否是以138或者139开头的手机号
public class RegExpDemo10 {

    public static void main(String[] args) {
        String content = "13855556666";
        boolean matches = content.matches("^1(38|39)\\d{8}$");
        if(matches){
            System.out.println("验证成功");
        }else{
            System.out.println("验证失败");
        }
    }
}
